module(
    name = "rules_img",
    version = "0.2.10",
    compatibility_level = 1,
)

bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "platforms", version = "0.0.11")

prebuilt_img_tool = use_extension("@rules_img//img/private/prebuilt:prebuilt.bzl", "prebuilt_img_tool")
prebuilt_img_tool.collection(
    name = "img_toolchain",
)
prebuilt_img_tool.from_file(
    collection = "img_toolchain",
    file = "@rules_img//:prebuilt_lockfile.json",
)
use_repo(
    prebuilt_img_tool,
    "img_toolchain",
)

# register a prebuilt toolchain of the img tool.
register_toolchains(
    "@img_toolchain//:all",
)

pull_tool = use_extension("@rules_img//img/private/prebuilt:prebuilt.bzl", "pull_tool")
pull_tool.collection(name = "pull_hub_repo")
pull_tool.from_file(
    collection = "pull_hub_repo",
    file = "@rules_img//:pull_tool_lockfile.json",
)
use_repo(
    pull_tool,
    "pull_hub_repo",
)
